# 导入模块
from common.send_method import *
import jsonpath
# 创建一个类
class DeleteMEssage:
  # 定义删除顾客信息的方法
  @staticmethod
  def delguke(cookie,url,data):
    headers = cookie
    try:
      # 发送请求
      #调用send_menthod方法请求数据
      result = SenMethod.send_method(method='post',url=url,data=data,headers=headers)
      res = result.json()
      print(res)
      # res2 = jsonpath.jsonpath(res,'')
      print(res)
      print('删除成功')
    except Exception as e:
      print('删除失败')
      # # 检查点
      # try:
      #   result2 = jsonpath.jsonpath(result.json(), '$..array[]')
      #   print('接口正常')
      #   print('删除成功')
      # except Exception as e:
      #   print('未正常返回')
      #   result2 = False
      # return result2

if __name__ == '__main__':
    cookie = api_login('admin',12345)  # 登录
    url = 'http://kumanxuan1.f3322.net:8096/MMS/Client/DeleteRows'
    data = {'array[]':'啦啦256'}
    DeleteMEssage.delguke(cookie,url,data)
